<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <style>
        .winner{
            width: 100px;
            height: 100px;
            background-color: aqua;
        }
        .inner{
            width: 50px;
            height: 50px;
            background-color: brown;
        }
    </style>
<body>
    <!-- 事件修饰符 -->
    <div class="box">
        <!-- .prevent 取消事件的默认行为 -->
        <a v-bind:href="url" @click.prevent>百度一下</a>
        <!-- .stop 取消事件冒泡 -->
        <div class="winner" @click="sameTest1">
            <div class="inner" @click.stop="sameTest2"></div>
        </div>
    </div>
    <script>
        let vm = new Vue({
            el:'.box',
            data:{
                url:'http://baidu.com'
            },
            methods:{
                sameTest1(){
                    console.log(111);
                },
                sameTest2(){
                    console.log(222)
                }
            }
        })
    </script>
</body>
</html>